#pragma once
#ifndef __BLOCK__H__
#define __BLOCK__H__

#include <vector>
#include "Cell.h"

namespace ATSudokuEngine
{

const static UInt32 MAX_BLOCK_CELLS = 81;
const static UInt32 MAX_CELLS = MAX_BLOCK_CELLS*MAX_BLOCK_CELLS;	//6561 = 81 X 81

typedef std::vector<const Cell*> Cells;
typedef std::vector<const Cell*>::iterator CellIterator;
typedef std::vector<const Cell*>::const_iterator CellConstIterator;

class Block
{
public:
	Block(){}
	~Block(){}

	UInt32 Add(const Cell* pCell);
	void Clear();
	virtual Bool Set(UInt32 nIndex, UInt32 nValue);

	const Cell* At(UInt32 nIndex) const;
	Bool Clone(UInt32 nIndex, Cell& aCell) const;
	virtual UInt32 Size() const;
	virtual UInt32 Length() const;

	const Cell* Find(UInt32 nCellIndex);

	/// Checking Cell's value is exist in Block
	Bool IsExist(UInt32 nValue) const;
	/// Checking duplicated Cell's value
	Bool IsValid() const;

	CellConstIterator BeginCells() const;
	CellConstIterator EndCells() const;
protected:
	Cells	vCells_;
};

}	// namespace ATSudokuEngine

#endif